<template>
    <HeaderButton v-if="getFirm && getFirm.length === 1" :theme="props.theme" class="firm-info">
        <a target="_blank" :href="firm?.url">{{ firm?.name }}</a>
    </HeaderButton>
</template>
<script setup>
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { usePermissionStore } from '@iframe/tools/store/modules/permission'
import HeaderButton from '/@/components/HeaderButton/index.vue'

const permissionStore = usePermissionStore()
const { getFirm, getFirmId } = storeToRefs(permissionStore)

const props = defineProps({
    theme: {
        type: String
    }
})

const firm = computed(() => {
    return getFirm.value.find(item => item.id === getFirmId.value)
})
</script>
<style lang="less" scoped>
.firm-info {
    height: 60px;
    margin: -9px 0 0;
}
</style>
